package com.lanhai.zhonglai.hc;

import java.util.LinkedList;
import java.util.Queue;
 

 
public class HCQueue {
	static Queue<HCQueueData> queue = new LinkedList<HCQueueData>();

	public static synchronized void Push(String ip,int port ,byte[] data,String remark,String stationname) {

		for(int i=0;i<6;i++) {
			HCQueueData obj=new HCQueueData();
			obj.setData(data);
			obj.setIp(ip);
			obj.setPort(port);
			obj.setRemark(remark);
			obj.setStationName(stationname);
			queue.offer(obj);
		} 

	}

	public static synchronized HCQueueData Pop() {

		if (queue.isEmpty()) {
			return null;
		}
		HCQueueData item = queue.poll();
		return item;
	}
}
